var service_common = require("common.js");

//对外公开的方法
module.exports = {
  payVip: payVip,
  payDaiLi: payDaiLi
}

/**
 * 购买VIP
 */
function payVip(grade, cb) {
  service_common.fetchData(
    service_common.getUrl("user.getVipPayment"),
    {
      openid: getApp().globalData.openid,
      grade: grade
    },
    function (res) {
      cb(res);
    },
    "GET"
  )
}

/**
 * 购买代理
 */
function payDaiLi(grade, cb) {
  service_common.fetchData(
    service_common.getUrl("user.getDaiLiParment"),
    {
      openid: getApp().globalData.openid,
      grade: grade
    },
    function (res) {
      cb(res);
    },
    "GET"
  )
}